package com.my.thread_pool;

import com.alibaba.fastjson.JSON;

import java.util.Random;

public class UserInfoDetalImpl extends UserInfoDeal<UserInfo, Integer> {

    @Override
    public void deal(UserInfo param, Integer result) {
        Random random = new Random();
        //result = random.nextInt(50);
        result = param.getId() * 1000;
        System.out.println(Thread.currentThread().getName() + "   result is;" + result + "     " + System.currentTimeMillis());
        try {

            Thread.sleep(result);
            param.setCount(result);
            System.out.println(Thread.currentThread().getName() + "   end time is;" + System.currentTimeMillis());
            System.out.println("=====" + JSON.toJSONString(param));
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
